(function () {
  let myChart = echarts.init(document.querySelector(".box-r3"));
  option = {
    title: {
      show: true,
      text: "标题样式",
      textStyle: {
        color: "white",
        fontSize: 18,
      },
    },
    legend: {
      top: 50,
      textStyle: {
        color: "white",
      },
    },
    color: [
      "#FF9393",
      "#45C2E0",
      "#C1EBDD",
      "#FFC851",
      "#5A5476",
      "transparent",
      "#transparent",
      "#transparent",
      "#transparent",
      "#transparent",
    ],
    toolbox: {
      show: true,
      feature: {
        mark: { show: true },
      },
    },
    grid: {
      bottom: 10,
    },
    series: [
      {
        name: "Nightingale Chart",
        type: "pie",
        startAngle: 0,
        radius: [100, 130],
        center: ["50%", "50%"],
        roseType: "area",
        itemStyle: {
          borderRadius: 8,
        },
        data: [
          { value: 10, name: "图例 1" },
          { value: 18, name: "图例 2" },
          { value: 30, name: "图例 3" },
          { value: 40, name: "图例 4" },
          { value: 68, name: "图例 5" },
          { value: 26 },
          { value: 22 },
          { value: 18 },
          { value: 18 },
          { value: 28 },
        ],
      },
    ],
  };
  myChart.setOption(option);
  //   window.onresize = () => {
  //     myChart.resize;
  //   };
  window.addEventListener("resize", () => {
    myChart.resize();
  });
})();
